package com.backend.securitiessystem.enums;
import lombok.Getter;

/**
 * 返回信息枚举类
 *
 * @author tuyufeng
 * &#064;date  2024/05/20
 */
public enum AppHttpCodeEnum {

    // 成功段0
    SUCCESS(200, "操作成功"),
    CRAWLER_SUCCESS_INDEX(201,"爬虫成功 -> 获取中国指数"),
    CRAWLER_SUCCESS_NEW_SHARE(202,"爬虫成功 -> 获取新股票"),
    CRAWLER_SUCCESS_FLASH(203,"爬虫成功 -> 获取快讯"),
    CRAWLER_SUCCESS_CAPITA_FLOW(204,"爬虫成功 -> 获取港股通资金流"),
    CRAWLER_SUCCESS_RISE_FALL(205,"爬虫成功 -> 获取跌涨信息"),
    // 登录段1~50
    // 参数错误 500~1000
    SERVER_ERROR(500, "服务器内部错误"),
    PARAM_REQUIRE(501,"缺少参数" ),
    PAGE_PARSING_FAILURE(502,"页面解析失败"),
    DATE_PARSING_FAILURE(503, "时间转换失败"),

    // 数据错误 1000~2000
    CRAWLED_DATE_IS_EMPTY(1000, "爬取的数据为空"),
    PAGE_LOAD_FAILURE(1001, "访问目标页面失败"),
    CRAWLER_FAIL_INDEX(1002,"爬虫失败 -> 获取中国指数"),
    CRAWLER_FAIL_NEW_SHARE(1003,"爬虫失败 -> 获取新股票"),
    CRAWLER_FAIL_FLASH(1004,"爬虫失败 -> 获取快讯"),
    CRAWLER_FAIL_CAPITA_FLOW(1005,"爬虫失败 -> 获取港股通资金流"),
    CRAWLER_FAIL_RISE_FALL(1006,"爬虫失败 -> 获取跌涨信息");
    // 数据错误 3000~3500

    @Getter final int code;
    final String message;

    AppHttpCodeEnum(int code, String msg) {
        this.code = code;
        this.message = msg;
    }

    public String getMsg() {
        return message;
    }
}

